﻿<vw:PhoneApplicationPageBase 
    x:Class="WaitLess.App.Views.DetailsPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:vw="clr-namespace:WaitLess.App.Views"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    d:DataContext="{d:DesignData DetailsPageDesignDataContext.xaml}"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768" 
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait" 
    shell:SystemTray.IsVisible="True"
    ApplicationBar="{StaticResource GlobalAppBar}">

    <!--Data context is set to sample data above and first item in sample data collection below and LayoutRoot contains the root grid where all other page content is placed-->
    <Grid x:Name="LayoutRoot" Background="#2A2A2A">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <toolkit:PerformanceProgressBar x:Name="performanceProgressBar" IsIndeterminate="True"
                                        VerticalAlignment="Top" Visibility="{Binding IsDataLoaded, Converter={StaticResource isDataLoadedToVisibilityConverter}}" />

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="PageTitle" Text="WachtMinderInA" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock x:Name="ListTitle" Text="{Binding Title, Converter={StaticResource municipalOfficeNameToTitleConverter}}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

        <!--ContentPanel contains details text. Place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <StackPanel Orientation="Horizontal" Background="#CB0B3C">
                <Image Source="/Assets/ApplicationIcon.png" Height="25" ImageFailed="Image_ImageFailed" />
                <TextBlock x:Name="hereNowCount" Text="{Binding HereNowCount}" Style="{StaticResource PhoneTextLargeStyle}" 
                           Foreground="White"/>
                <TextBlock Text="personen op dit moment" Style="{StaticResource PhoneTextNormalStyle}" Margin="0,8,0,0" 
                           Foreground="#F38F11"/>
            </StackPanel>
            <StackPanel Grid.Row="1">
                <Image Source="{Binding MunicipalOfficeId, Converter={StaticResource municipalOfficeToImageConverter}}" 
                                Stretch="UniformToFill"></Image>
            <TextBlock x:Name="ContentText" Text="{Binding Address}" TextWrapping="Wrap" Style="{StaticResource PhoneTextNormalStyle}"/>
            </StackPanel>
        </Grid>
    </Grid>

    <toolkit:TransitionService.NavigationInTransition>
        <toolkit:NavigationInTransition>
            <toolkit:NavigationInTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardIn"/>
            </toolkit:NavigationInTransition.Backward>
            <toolkit:NavigationInTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardIn"/>
            </toolkit:NavigationInTransition.Forward>
        </toolkit:NavigationInTransition>
    </toolkit:TransitionService.NavigationInTransition>
    <toolkit:TransitionService.NavigationOutTransition>
        <toolkit:NavigationOutTransition>
            <toolkit:NavigationOutTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardOut"/>
            </toolkit:NavigationOutTransition.Backward>
            <toolkit:NavigationOutTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardOut"/>
            </toolkit:NavigationOutTransition.Forward>
        </toolkit:NavigationOutTransition>
    </toolkit:TransitionService.NavigationOutTransition>

</vw:PhoneApplicationPageBase>